<template>
	<view class="home">
		<view class="box">
			<view class="flex_lr service">
				<view class="flex_row">
					<image class="service_img" src="/static/board/head.png" mode=""></image>
					<view class="f1" style="color: #FFF;">客服</view>
				</view>
				<image @click="PhoneCall" class="phone_img" src="/static/board/call.png" mode=""></image>
			</view>
			<view class="box_list margin-top-40">
				<view class="f1">留言</view>
				<view style="margin-top: 20rpx;">
					<textarea v-model="data.message" class="txt" placeholder="留言给平台" style="width: 100%;"></textarea>
				</view>
				<view class="flex_lr list">
					<view class="f1">联系人姓名</view>
					<view class="flex_row">
						<input v-model="data.name" class="list_input" type="text" placeholder="请输入姓名"/>
						<text class="tyIcon-arrow-right text-24 text-77"></text>
					</view>
				</view>
				<view class="flex_lr list" style="border: none;">
					<view class="f1">联系人电话</view>
					<view class="flex_row">
						<input v-model="data.contact_number" class="list_input" type="text" placeholder="请输入电话"/>
						<text class="tyIcon-arrow-right text-24 text-77"></text>
					</view>
				</view>
			</view>
		</view>
		<view class="y_center">
			<view @click="contact_support" class="box_but flex_center">提交</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				hotline:'',
				data:{
					message:'',
					contact_number:'',
					name:'',
				},
			}
		},
		onLoad() {
			this.init()
		},
		methods: {
			init(){
				this.rq.getData('Wechat/customer_phone',{} ).then(res => {
					if (res.code == 1) {
						this.hotline  = res.data.hotline
					}
				})
			},
			contact_support(){
				this.rq.getData('Wechat/contact_support',this.data ).then(res => {
					if (res.code == 1) {
						this.cn.toast(res.msg)
						this.data = {
							message:'',
							contact_number:'',
							name:'',
						}
					}
				})
			},
			PhoneCall(){
				uni.makePhoneCall({
				    phoneNumber: this.hotline,
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.box{
		margin: 40rpx;
	}
	.service{
		border-radius: 50rpx;
		padding: 40rpx 30rpx;
		background: #000;
		.service_img{
			width: 120rpx;
			height: 120rpx;
			border-radius: 50%;
			margin-right: 20rpx;
		}
		.phone_img{
			width: 90rpx;
			height: 90rpx;
			border-radius: 50%;
		}
	}
	.txt{
		background: #f3f3f3;
		padding: 20rpx;
		border-radius: 30rpx;
	}
	.f1{
		font-size: 30rpx;
		font-weight: bold;
	}
	.box_list{
		background: #FFF;
		box-shadow: 5px 5px 10px 0 rgba(186, 186, 186, 0.7);
		border-radius: 30px;
		padding: 40rpx 40rpx 20rpx 40rpx;
		.list{
			min-height: 100rpx;
			padding-bottom: 10rpx 0;
			margin-bottom: 10rpx;
			border-bottom: 2rpx solid #d1d1d1;
			.list_input{
				text-align: right;
			}
		}
		.box_list_img{
			width: 80rpx;
			height: 80rpx;
			border-radius: 50%;
			margin-right: 20rpx;
		}
		.f2{
			font-size: 26rpx;
		}
		.f3{
			font-size: 75rpx;
		}
		.up_img{
			width: 180rpx;
			height: 180rpx;
			border-radius: 10px;
			background-color: #f3f5f7;
		}
	}
	.sex_box{
		border-radius: 10rpx;
		background: #000;
		color: #FFF;
		padding: 10rpx 40rpx;
	}
	.sex_box_b{
		border-radius: 10rpx;
		color: #000000;
		border: 2rpx solid #000;
		padding: 10rpx 40rpx;
	}
	.box_but{
		position: fixed;
		bottom: 100rpx;
		width: 80%;
		font-size: 34rpx;
		color: #FFF;
		padding: 30rpx 0;
		background: #000;
		border-radius: 50rpx;
	}
</style>